<?php


namespace App\Models\Material;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class OutMaterialDetail extends Model
{
    protected $table = 'akbus_material_out_detail';

    protected $fillable = [
        'out_id',
        'material_id',
        'supplier',
        'specs',
        'unit',
        'amount',
        'price',
        'del_state',
        'created_at',
        'updated_at',
        'line',
        'bus_num',
        'is_consumables',
    ];

    /**
     * 不可批量赋值的属性。
     *
     * @var array
     */
    protected $guarded = [
    ];

    /**
     * 类型转化
     *
     * @var array
     */
    protected $casts = [
    ];

    /**
     * 隐藏的字段
     *
     * @var array
     */
    protected $hidden = [
    ];

    /**
     * 出库
     */
    public function material():BelongsTo
    {
        return $this->BelongsTo(Material::class);
    }

    public function outMaterial():BelongsTo
    {
        return $this->BelongsTo(OutMaterial::class);
    }
}
